#!/bin/sh

echo "#######Step 1: Install nfs and rpcbind#######"
sudo yum install -y nfs-utils
sudo yum install -y rpcbind

echo "#######Step 2: Create a folder to be mounted#######"
sudo mkdir -p /home/martin/mnt/protected
sudo mkdir -p /home/martin/mnt/public

echo "#######Step 3: Mount nfs#######"
sudo mount 10.0.2.8:/data/protected /home/martin/mnt/protected
sudo mount 10.0.2.8:/data/public /home/martin/mnt/public

echo "#######Step 4: Test#######"
cat /home/martin/mnt/protected/protected.txt
sudo bash -c 'echo "Public" > /home/martin/mnt/public/public.txt'
sudo bash -c 'echo "Public" > /home/martin/mnt/protected/protected.txt'
